script_info = {
	["title"] = "官方通道",
	["version"] = "0.0.1",
	["description"] = "#SVIP推荐#SVIP可满速",
	["color"] = "#665cf0",
}
     
function onInitTask(task, user, file)
    if task:getType() ~= TASK_TYPE_BAIDU then
        return false
    end
    if user == nil then
        task:setError(-1, "用户未登录")
		return true
	end	
    task:setUris("http://d.pcs.baidu.com/rest/2.0/pcs/file?app_id=250528&method=download&path="..pd.urlEncode(file.path))
    task:setOptions("user-agent", "netdisk;P2SP;2.2.60.26")
    task:setOptions("header", "Cookie: "..user:getCookie())
    task:setOptions("piece-length", "2M")
	task:setOptions("max-connection-per-server", "32")
    task:setOptions("allow-piece-length-change", "true")
    task:setOptions("enable-http-pipelining", "true")
	if user:isSVIP() then
		task:setIcon("icon/svip.png", "SVIP加速中！")
	end
	
    return true
end